How to describe a piece measure by measure?

Jacques Duthen duthen@club-internet.fr
Thu, 08 May 1997 03:07:32 +0200


Hello,

I downloaded CMN a couple weeks ago and I've been playing
around with it.  It's really great!
Thank you, Rick and all who developed it.

Now, here is the introduction to my question: 
I would like to use cmn to print a small (considering the 
compositional quality) piece of music which contains
316 measures for about 25mn and has about 50 different parts
(of course, they never play all together).
The problem is that the piece is too long to consider typing 
every single note by hand in a big call to the `cmn' function.
Moreover, the piece already exists but it is a 142Kb file
in a special format:
it is the input data for a sequencer which I wrote, when I 
was working at Ircam, in PreFORM (a CLOS-like object-oriented 
extension of Le_Lisp).

As you will notice, the concepts are rather innovative ;-)
The sequencer plays an object called a `piece'.
A piece is a sequence of `measures'.
A measure has a `time-signature' and assigns `patterns' to
`instruments'.
A pattern is a list of chords or notes with a pitch, a sequential 
duration, a real duration and a velocity.

Here is a simple example of such a piece (I took off unnecessary 
details (like tempo, transpositions...)):

(def-time-signature ts-5/4 "time signature for mes A and B"
  5 4)

(def-pattern bass-pat-AB "bass pat for mes A and B"
  '(a2 d3   g3 e3)
  '( 2  4    2  2)  ;; delta between notes-on
  '( 2  2    2  2)  ;; durations
  '(90 60   80 60)) ;; velocities

(def-pattern org-pat-A "org pat for mes A"
  '(e4 fs4 a4 b4 g4)
  '( 2   2  2  2  2)  ;; delta between notes-on
  '( 1   1  1  1  1)  ;; durations
  '(80  80 80 80 80)) ;; velocities

(def-pattern org-pat-B "org pat for mes B"
  '(cs5 a4 fs4 d4 b3)
  '( 2   2  2  2  2)  ;; delta between notes-on
  '( 1   1  1  1  1)  ;; durations
  '(80  80 80 80 80)) ;; velocities

(def-measure measure-A "mes A" 'ts-5/4
  '((bass-instrument . bass-pat-AB)
    (org-instrument  . org-pat-A)))

(def-measure measure-B "mes B" 'ts-5/4
  '((bass-instrument . bass-pat-AB)
    (org-instrument  . org-pat-B)))

(def-piece the-piece "a very nice piece ;-)"
 '(measure-A measure-A measure-A measure-A
   measure-B measure-B measure-B measure-B))

As you can see, the organisation is the opposite of cmn's one
(considering the two dimensions: parts and measures).
I chose deliberately this kind of organisation because it is
very convenient for repetitive / minimal music (with many similar
measures or patterns).  

Now, my problem is: how to convert this stuff to cmn?

As I said earlier I don't want to write every note by hand, 
but I would agree to do any kind of automatic or semi-automatic
modification of my file (using sed, awk, yacc, or whatever
(even lisp, of course (common- or emacs-) :-)).

I can imagine (I guess) how to write the functions def-piece,
def-measure and def-pattern in cmn, presumably using the `engorge'
functions, but I would previously like to know if anybody 
has already written something similar to them or if anybody
can give me any hints about the right way to do it or any
example of code that might help.

I don't have clm and don't know precisely what it does.
Would it be useful for my needs?

Thank you in advance for any answer (preferably helpful ;-)
                                                             [jack]
-- 
| # # | # # # | # # | # # # | # # | # # # | Jacques Duthen   [jack] |
| # # | # # # | # # | # # # | # # | # # # | duthen@club-internet.fr |
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|