Ceci est une ancienne révision du document !
OpenMusic | Lisp/Visual Programming | Computer-Assisted Composition
Hochschule für Musik Karlsruhe | Summer semester 2019
• Symbolische Programmierung mit Common Lisp (SPCL-2)
• Musikalische Anwendungen der Symbolischen Programmierung (MASP-2)
26/04 – 10/05 – 17/05: SPCL-2 11:00-12:30 | MASP-2 14:30-16:00 13:30-15:00
21/06 – 28/06 – 05/07: SPCL-2 11:00-13:00 | MASP-2 14:30-16:30 14:00-16:00
Rules for Summesemester 2019 :
- If you want to register to the course and examination: send me an email with your name before the end of the first session of courses (17/05)
- Please try to attend regularly. It's only 6 days.
Amir Teymuri provides tutoring hours for the Lisp classes. Contact him !
Software / downloads
- All OpenMusic-related projects (libraries etc.) : https://github.com/openmusic-project/
SPCL2
Topics covered in class #1 (26/04/2019): Lisp Basics, Evaluation, Assignation, Functions and Functional Programming
Topics covered in class #2 (10/05/2019): Conditionals, Applicative Programming, Recursion, Iterations
Topics covered in class #3 (17/05/2019): Types, Structures, Common Lisp Object System | Lisp files
Topics covered in classes #4 & #5 (21/06/2019): Packages, OM libraries, … | homework-solutions.lisp | objects.lisp | inheritance.lisp
Practice (classes #5 & #6) | The LOOPER class: looper.lisp | looper-editor.lisp.
Project
For the Lisp part of the evaluation, you will have to deliver your own OM library.
Here is the template we made in class: ⇒ your-lib.zip.
Common Lisp
Reading:
Interesting litterature and books on Lisp are freely available online. Have a look in particular at:
- On Lisp by Paul Graham. Chapters 1 to 4.
- COMMON LISP: A Gentle Introduction to Symbolic Computation by David S. Touretzky. Chapters 1 to 7.
… and the reference Common Lisp textbook:
- Common Lisp, the Language, 2nd Edition (aka CLtL2) by Guy L. Steele Jr.
Common Lisp specs:
- Simplified: http://jtra.cz/stuff/lisp/sclr/
Hints to edit Lisp code in OM
The OM Listener Window (see "Windows" menu) is the hub of the Lisp REPL. Keep it open and at sight (there's an option in the OM preferences to keep it in front of other windows). Open text buffers with the menu File/New. Save regularly and name your Lisp files with teh extension ".lisp" so that OM understand this is Lisp code. In order to evaluate an expression, select it and use CMD+E (see the menu "Lisp") If no expression is selected, the expression ending at the closing parenthesis immediately above the cursor will be evaluated. You can also evaluate the whole file with CMD+Y (beware that all the expressions will be evaluated: keep your code clean and use comments !) Prints and evaluation results are output to the Listener window. Alternatively, the command CTRL+X-E also evaluates the expression or symbol ending right before the cursor. The result is printed on the little text area at the bottom of the text editor.
MASP2
⇒ Download/import all OM patches from here: [OpenMusic-patches]
Patch previews (Click to enlarge pictures…)
MASP-2 Audio patches (05/07/2019)
⇒ HERE
OpenMusic
Hints and keyboard shortcuts
m = show / hide contents v = evaluate the box b = lock/unlock the box evaluate a specific output = cmd+click space-bar = play i = initialize box size n = display / hide the name of the box d = show documentationIn the editors: add something = cmd+click
Readings
⇒ Vol. 2 (2008) PDF (38.9Mo) / PDF (low-res/8.3Mo), Vol. 3 (2016) PDF (91.8.9Mo) / PDF (low-res/15.7Mo).
Some chapters about interpolation here.