On Sunday 29 August 2004 09:29, Guillaume Laurent wrote:
> On Sunday 29 August 2004 01:50, Pedro Lopez-Cabanillas wrote:
> > My plan is to first write a 'cake2rg' standalone utility, to start
> > learning the file format and meanwhile to produce some practical results.
>
> If you still have a working copy of Cakewalk, you might want to look what
> formats it can export. I also recall that it featured some lisp-like
> language with which you could write scripts to process notes. If this
> language has some sort of 'printf' function, you could whip up some sort of
> text dump and then turn that into an rg file.

Cakewalk can export standard MIDI files too, which can be imported from RG. 
There is also a better option for a massive batch conversion: an old program 
CAKE2ASC.EXE that turns a WRK file into a pretty clear ASCII text format, but 
the latter version of it was from Cakewalk 4.0 for MS-DOS, and it doesn't 
recognize many newer file formats, for instance the chunks holding the 
lyrics. It can be used from dosbox (it doesn't run under dosemu/freebox).

The Cakewalk scripting feature uses a language named CAL. It can process one 
already loaded song, doing with it whatever you want. The attached file is 
one of my old CAL programs. It converts the selected long notes into trills. 
The problem is that I don't want to have a working instance of the other 
operating system in order to run Cakewalk. In this moment, I don't have one.

Regards,
Pedro
;;; Trino.CAL
;;;
;;;
;;; prolog expression
(do
  (int minimo 120)
  (int durada 15)
        (int interval 2)
  (dword momento)
  (int canal)
  (word total)
  (int base)
  (int nuevo)
  (int velo)
  (word doble)
  (word limite)
  (getInt minimo "Nota minima para trinar?" 1 32767)
  (getInt durada "Duracion de cada nota del trino?" 1 120)
        (getInt interval "Intervalo del trino" 1 2)
  (= doble (* durada 2))
)
;;;
;;; body expression - evaluated once for each selected event
(if (== Event.Kind NOTE)
    (if (>= Note.Dur minimo)
        (do
            (= momento Event.Time)
            (= canal Event.Chan)
            (= total Note.Dur)
            (= base Note.Key)
            (= velo Note.Vel)
            (delete)
            (= nuevo base)
            (+= nuevo interval)
            (= limite (/ total 4))
            (if (< limite doble)
                (= limite doble)
                NIL
            )
            (while (> total limite)
                   (do
                       (insert momento canal NOTE base velo durada)
                       (+= momento durada)
                       (insert momento canal NOTE nuevo velo durada)
                       (+= momento durada)
                       (-= total doble)
                   )
            )
            (insert momento canal NOTE base velo total)
        )
        NIL
    )
    NIL
)
;;;
;;; epilog expression

NIL













Reply via email to