Documente Academic
Documente Profesional
Documente Cultură
Mondegreen Team
Apoorv Agawal Architect aa2644@columbia.edu
Brian Hsieh Tester bh2181@columbia.edu
Pier Francesco Palamara Tools Guru pp2314@columbia.edu
Tal Giat Project Manager tg2235@columbia.edu
2
2 http://fractalcomposer.com/
3 http://www.contextfreeart.org/
3
III. Syntax
AMFM has a succinct syntax, which consists mostly of simple rule definitions (rules
are equivalent to procedures in other languages). There are very few operators or
expressions and there are no semicolons.
A rule can only contain instruments and rule executions. The arguments for a rule
execution are the dimensions we want to apply the fractal behavior on, two options
are available P – for pitch and V- for volume. Thus a rule execution can be called
with zero and up to two arguments.
Musical Notes
We borrow the syntax used by fractal composer6 for the specification of our seeds.
The syntax for the seeds has the following format:
4 http://java.sun.com/products/java‐media/sound/
5 http://en.wikipedia.org/wiki/Midi
6 http://fractalcomposer.com/
4
with:
• Pitch Class: A letter name (A to G), optionally followed by a #
• Octave: A number from 0 to 9 specifying which octave this note is in.
• Duration Fraction: A fraction indicating how long the note should last.
• Volume: One of PPP, PP, P, MP, MF, F, FF or FFF, listed in magnitude order.
Example of a seed:
All notes for all instruments should be the same length otherwise a semantic error will
be returned.
Example I
startrule RULE1
maxbars 3
RULE1{
RULE1()
5
Example II
startrule RULE1
maxbars 4
RULE1 p4{
RULE1(P)
RULE1{
RULE1(P)
RULE2 ()
RULE2 {
RULE2 (V)
The user starts by defining a few rules and a start rule. Rules contain the instrument to
be played and the notes. 'P' in RULE1 implies the fractal function is applied on the
pitch of the notes, 'T' stands for volume. p<x> are the probabilities with which a
certain rule will be selected. The timeline below shows the step-by-step traversal of
our program.
6
Example I shows the way Fractal composer will perform if we were to use our
language to mimic it. Example II shows the strength of our language in comparison to
Fractal Composer. In Example I, the first line of code states the starting rule. Since
there is only one RULE1, it is called. maxbars specifies the length of time for which
the composition resulting from our language will be played for. Once RULE1 is
called the statements inside the RULE1 block are expanded. It must be noted that the
expansion follows a breadth first order of expansions. For instance, when RULE1 is
called, the statement stating the instrument (Piano in this case) and a call to RULE1
are put at the head of a priority queue. Once Piano is expanded, the instrument to be
played becomes available. Also, the notes and their length is available at this point.
Thereafter, RULE1 is called again. The empty parenthesis in our sample example
could have for instance P (pitch) or T (volume) as an input. Empty parenthesis means
play the earlier set of notes again without any transformation. In case of P, a fractal
transformation will be applied to the pitch and then played using the instrument in
context. Example II conveys the probabilistic nature of our language that makes it a
dynamic tool for producing music. The probabilities are optional to mention. If they
are absent, they'll be assumed as 1. Moreover, probabilities of the same rule should
sum to 1. In case they are greater or less than 1, we could either lag an error message
or normalize the probabilistic scores to make them sum to one. This is actually a
design question that we look to resolve at the time of fixing a grammar for our
language.