Lisp Variables

Translating a complete composition from traditional notation to a list of events can typically result in a cumbersome list of data. Binding data to variables helps to efficiently enclose data in an abstraction, thus greatly facilitating its manipulation in the programming environment. Enclosing data in a variable can be done in Lisp by using setq (set quote). For example, the symbol first-beat can be assigned to represent the events that constitute the first chord of the chorale shown before:

(setq first-beat '((0 60 1000 4 60)(0 64 1000 3 60)(0 67 1000 2 60)(0 72 1000 1 60)))