• # Lesson 1. Creating and Processing a List

## Annotation

SETF is a LISP term that ‘sets’ a word (pitches, in this example) to a given list. This means that every time we use the word pitches, Opusmodus will know that we actually mean the pitch sequence (c4 cs4 fs4 g4 c5). This is known as a variable. It saves us time: instead of writing out all five pitches every time we want to use them, all we have to do is use the variable name pitches. This is very much the same as saying: pitches = (c4 cs4 fs4 g4 c5). This means that pitches can be used to create the variable transposed-pitches by this expression:

`(setf transposed-pitches (pitch-transpose -12 pitches))`

In other words: transposed-pitches = (c3 cs3 fs3 g3 c4). Transposition is a function we constantly use in composing music whether we use computers or not. (pitch-transpose -12 pitches) is a function with a parameter -12 and a variable pitches. In this context, -12 means transpose the variable pitches down an octave. The function SPAN is something else. It’s unique to Opusmodus. We’ve got five pitches, so let’s 'span' a single 1/8 note length across those pitches: lengths = (1/8 1/8 1/8 1/8 1/8). Essentially SPAN will repeat material until it is the same length as the longer of two lists: useful for ensuring your compositional material aligns! For this fragment the metre is 5/8. To get this to show up correctly on the Notation and MIDI displays a time-signature has to be generated. This is how it’s done. Make sure you examine the output of each (use the ⌘E shortcut):

```(setf timesigs (get-time-signature lengths))
=> (5 8)```

This means 1 bar of 5/8. From here on the score is defined. This is one of two ways to do it. In each part of the piano the musical parameters are each defined separately, drawing on the pitch, length and velocity material previously created. In Lesson 2 we’ll see the other way of doing this – with the Opusmodus Notation (OMN) script. Finally, take a look at the dynamics. By repeating the crescendo < for each note you can get a dynamic hairpin of the correct length.

`(setf dynamics '(p< < < < ff))`

## Score

```(setf pitches '(c4 cs4 fs4 g4 c5))
(setf transposed-pitches (pitch-transpose -12 pitches))
(setf lengths (span pitches '(1/8)))
(setf dynamics '(p< < < < ff))
(setf timesigs (get-time-signature lengths))

(def-score lesson-1
(:key-signature 'chromatic
:time-signature timesigs
:tempo 80
:layout (piano-layout 'piano-rh 'piano-lh))

(piano-rh
:length lengths
:pitch pitches
:velocity dynamics
:channel 1
:sound 'gm
:program 'acoustic-grand-piano)

(piano-lh
:length lengths
:pitch transposed-pitches
:velocity dynamics)
)```

## Notation Next page Lesson 2. Introducing OMN

Go back to Reference page.

Edited by opmo

×

• Lessons