How to describe a piece measure by measure?

Jacques Duthen duthen@club-internet.fr
Sat, 10 May 1997 04:23:02 +0200


First of all, I would like to thank Tobias Kunze, Bill Schottstaedt 
and Rick Taube who took the time to reply: the interaction seems 
better than in certain newsgroups ;-) even with a far french
interlocutor.

Bill Schottstaedt wrote:
> The first thing that occurs to me is that you could use
> cmn "sections" for the patterns.  Then the def-piece call
> could be used almost as is.  I don't know of any code
> already written to do this kind of translation, but it
> doesn't look too difficult -- if you have problems, let
> me know, and I'll conjure up something.

I looked at the 'section' function.  Do you think I could ask my
def-measure function to return a section (with as many staves as
I have instruments in the piece (inserting rests for instruments
who don't play in this section/measure)) and concat all of them?

> > I don't have clm and don't know precisely what it does.
> > Would it be useful for my needs?
> 
> Probably not -- CLM is a synthesis package, in the same
> ballpark as Csound.

OK, now, I realize that my question should have been (don't
answer to the following question): 
"what are cm, clm, cmn and what is their relationship?"
or, at least (don't answer to the following question):
"Would _CM_ be useful for my needs?"  
So, as everything in the different suggestions I received 
was not clear for me, and as some of them mention CM, 
I decided to download it and I am now in the process of RTFMing.  

Clearly CLM is for synthesis and thus is off-topic (english?).

So, considering using or not using CM, the manual says:

   The CMN output syntax
   ---------------------

   The CMN syntax writes postscript output or CMN input from normal
   event data in Common Music. It is not a substitute for working with
   CMN directly to produce manuscript quality output.

   When the CMN output syntax is current the write command creates
   either .eps (postscript) or .cmn (cmn input) files. .eps files
contain 
   a postscript image of our compositional data in common music
notation.
   .cmn files contain input expressions for the CMN program. These
   expressions can then be edited to produce a high quality manuscript.
   There is no backward link from .cmn to .cm files, so its best to
delay
   creating .cmn input files until the composition is finished.

This is a little bit confusing: is CM higher level than CMN or not?
Can CM produce _everything_ needed by CMN (like time signature,
accents, text- -text- and -text, etc.).  I already noticed that
the 'data' function can be used to send time signature to cmn.  
And this is _very_ important:
The piece is mainly a combination of 17/8 and 21/8 (which correspond
to the theme of the Good and the theme of the Bad) with some extra 
variations (when they fight together).  Whatever clever cm or cmn might
be,
I cannot imagine it will recognize these time signatures without being
told!

I don't really need manuscript quality output, but reasonably high
quality would be nice, and I imagine that editing the .cmn file would
be a too hard and long job.  Of course, I realize that using CM gives 
me the benefit to be able to play midi and to produce a midi-file.

Bill Schottstaedt wrote:
> 
> The first thing that occurs to me is that you could use
> cmn "sections" for the patterns.  Then the def-piece call
> could be used almost as is.  I don't know of any code
> already written to do this kind of translation, but it
> doesn't look too difficult -- if you have problems, let
> me know, and I'll conjure up something.

This suggests not to use CM, does it?

What I had in mind with pure CMN was to make some CLOS classes
(pattern, measure, instrument, piece) _without_ using CM,
combined by the def-* macros and a method over piece like this:

(def-method extracts-parts-for-cmn ((self piece) instruments from to)
  "create a cmn object containing the parts for the given INSTRUMENTS
between measure FROM and measure TO")

The question is: should I use or ignore the CM classes to do so?

Tobias Kunze wrote:
> it seems to me as if you could port your def-* forms almost
> trivially to cm, from where you can write a cmn score file.  

This suggests to use CM, does it?  Should I subclass any CM class?
Could you point me to some section of the manual?

> You'll want to add some cmn objects in the stella structure,
> if you don't want cm to guess at the barlines and meters, though.

Tobias, excuse me.  Since I'm not good at understanding english,
I don't get the meaning of what you say, though I have the feeling
it's closely related to my previous question.  Can you elaborate
a little?  As I said the time signature is _very_ important:

> writing a lisp function to convert from horizontal to vertical representation
> doesn't strike me as trivial, however :)  since you'll have to time-sort
> events on the fly.

Hmm.  In the hypothesis to not use CM, I was thinking that my method
extracts-parts-for-cmn would be something like:

(loop for instrument in instruments do
   (setq aStaff (new-staff))
   (loop for measure in (self get-measures from to) do
      ;; Extract pattern played by instrument in this measure
      ;; or get a rest corresponding to the whole measure.
      ;; Add this pattern or rest to the current aStaff.
   )
   ;; Collect the staves in a system.
)

which is not so far from trivial :-)

Do you foresee any difficulties either using or not using CM?

Rick Taube wrote:
> >it is the input data for a sequencer which I wrote, when I was 
> >...
> >Now, my problem is: how to convert this stuff to cmn?
> 
> since your sequencer presumably writes midi files from your input, i would
> simply generate a midi file, then import that file into cm and write it out
> again as a cmn score:
>   import pc.midi
>   open test.clm ...
>   mix pc 0
> that will give you a version of your piece with all of the notes converted
> to cmn's format. its possible to  add cmn directives to your imported
> manterial (measure ect), but i would work directly with cmn once all the
> notes have been translated. actually, cmn is very smart about layout, you
> may not have to do anything special to get it to add measures/meter changes
> the way you want

Argl... there are _many_ reasons why I can't do that:
- PreFORM/Le_Lisp does not run very well under MacOS 7 (Actually, I did
not
  run it since 1989! (though it might be possible (I think)).  And now
  I am too used to MCL to step back to Le_lisp)
- I always wanted to implement a midi file output to my sequencer
  but never got time to do it
- the piece was played using only a DMP7, a RX5, two TX816, a TX802 and 
  a sampler which leads to a lot of program changes to handle the 50 
  virtual synthesizers
- there are "multiple" synthesizers. For example, to get a good piano
sound,
  the same chord is sent to 5 modules of one TX816 (each on a different
  channel), so it would be difficult to build the staves from the
midi-channel.
- each key-on is preceded by a volume change (for mixing purpose)
  this extra information might not be easy to use.
- my sequencer does not output any time signature information

Sorry to bother you again and thanks in advance
-- 
| # # | # # # | # # | # # # | # # | # # # | Jacques Duthen   [jack] |
| # # | # # # | # # | # # # | # # | # # # | duthen@club-internet.fr |
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|