CCRMA

Notes from the Metalevel

The Metalevel?

A few basic concepts from Rick Taube's book of the same name...

  • Score -- a representation of music
  • Performance of a score -- a rendering of the score

A score is a level of abstraction above a recording of sound coming from a performance of that score.

Is there a level of abstraction above a score? Yes, it is what Rick Taube calls the metalevel. If the score represents the composition, then the metalevel represents the composition of the composition. It deals with the process of musical composition as opposed to its artifact, the score.

Computer Composition

Computer assisted composition

The computer facilitates compositional tasks

Automatic composition

The computer system independently composes music

Computer based composition

Use the computer to express ideas at a higher level than the traditional score

WHY?

  • empirical activity, experimenting with ideas and testing them rapidly...
  • a metalevel allows the creation of compositional reusable building blocks
  • compositional tasks can be solved by generic algorithms
  • the same metalevel representation can generate many different scores
  • easily introduce probabilities or chance
  • small changes in the metalevel can have big effects on the score
  • simple expressions in the metalevel can generate very complex scores
  • changes in the metalevel can lead to unexpected changes in the score
  • a metalevel representation can be processes or generated by programs
  • exploration of compositional domains difficult or impossible to do without a computer

Lisp

Common Lisp vs. Scheme

We will be using several packages that augment the basic lisp language with additional constructs suited for score generation and sound rendering. Our basic lisp is going to be SBCL, the main packages on top of that will be Common Music (composing in the metalevel) and Common Lisp Music (sound rendering).

Common Music can work both in Common Lisp and in Scheme, and it includes some code that enables us to run most of its examples (which are written in Scheme) in Common Lisp. If you have used Scheme before (as in the Guile interpreter included in Snd) you will be familiar with, for example "define".

Lisp Data types

  • numbers
    • integers
    • real numbers
    • ratios
  • symbols (sequence of alphanumeric characters)
    • keywords
  • lists
    • property lists
    • function call lists

...some examples.

Lisp evaluation

  • self evaluating:
    • numbers
    • booleans
    • strings
  • symbols and variables
  • function call lists

Blocking evaluation: "quote"

Blocking evaluation: "backquote"

Functions, core functions you will need to know...

...evaluation examples.

...core lisp functions.

Iteration and the "loop" macro

Example: transposition

Loop is a macro that implements an English-like syntax for describin interactive tasks. Loop breaks the evaluation rules we just outlined! It does not follow the "lisp" rules of evaluation, it is its own little language for describing iteration.

...loop macro examples (text file available at: /usr/ccrma/web/html/courses/220b/nm/08/loop.cm).

Musical parameters

...musical parameter examples.

Common Music and Portmidi

What is portmidi? (the lisp interface as defined in Common Music)

Looking at what's available:

(pm:getdeviceinfo)

Connect to the default input and output

(portmidi-open
  :output (pm:GetDefaultOutputDeviceID)
  :input (pm:GetDefaultInputDeviceID))

so now we can start an external MIDI controlled synthesizer so that we can send MIDI notes to it. For example start Jack using Qjackctl, then start Qsynth and load a soundfont into it (the FluidR3 soundfont can be found on all machines at /usr/share/soundfonts/FluidR3_GM.SF2).

...score generation examples (strums function).

...a text file of scores.cm, save if somewhere and start evaluating parts of it in the interpreter!.

See example with fm-violin in addition to example with MIDI note class.

Algorithms and Processes

...algorithms and processes examples.

...a text file of processes.cm as modified in class.


©2000-2006 Fernando Lopez-Lezcano. All Rights Reserved.
nando@ccrma.stanford.edu