How to write expressions in Polyfoni Revised


Polyfoni Revised uses the Python Programming Language to evaluate the expressions you write.

Article: Expressions in Python

The four expressions for pitch, duration, rest, and velocity each get evaluated once for every note to be generated.

By using the variables x and y in an expression, it will evaluate to different results based on the location of the note. This is because, when evaluating, x gets replaced by the index of the note and y gets replaced by the index of the voice of the note.

Imagine it like this:

y=3 note note note note note note note note note note
y=2 note note note note note note note note note note
y=1 note note note note note note note note note note
y=0 note note note note note note note note note note
    x=0  x=1  x=2  x=3  x=4  x=5  x=6  x=7  x=8  x=9  ...

Building blocks

Return types

The expressions for pitchduration. and velocity must evaluate to numbers, meanwhile the expression for rest must evaluate to a boolean.

Get Polyfoni Revised

Buy Now24.00€ EUR or more