Help needed for Grace note CAL Program

Author
mrmick
Max Output Level: -90 dBFS
  • Total Posts : 6
  • Joined: 2006/03/30 08:46:12
  • Status: offline
2006/03/30 21:53:55 (permalink)

Help needed for Grace note CAL Program

Hi,
I was hoping for some help in writing a CAL routine. I've had a look at some I've downloaded but they are over my head.

What I'd like to do is have a CAL that will add a grace note to a snare drum note, to make a flam. To do this manually , I add a 32nd or 64th note just before the note and then lower the velocity a bit. Just thought it'd be great to be able to do this automatically by selecting the notes I want to flam, and then run a CAL on them.

Any help, much appreciated.

#1

2 Replies Related Threads

    shawnbulen
    Max Output Level: -87 dBFS
    • Total Posts : 157
    • Joined: 2006/02/11 20:51:07
    • Status: offline
    RE: Help needed for Grace note CAL Program 2006/03/31 01:10:28 (permalink)
    You can use the menus, it will take a few steps:
    1. Select your notes
    2. Edit|Copy
    3. Edit|Paste
    4. Process|Slide to move the notes over
    5. Process|Length to make the selected notes shorter
    6. Process|Scale Velocity to reduce the velocity

    Or, you can run the following CAL program. I did this the long, hard way, hopefully to make it somewhat self-documenting, and to make it a bit more robust. E.g., I do edits to make sure your start time won't go negative (if you operate on a note at 1:1:0) or that velocities won't go negative. It does not limit its action to specifically snare notes, it operates on all selected notes.

    Forgive the screwball formatting, this forum drops most whitespace. I've confirmed this works fine if you just copy the text below into Notepad & save it.
    ;
    ; Utility to insert 'flam' notes, short, quieter notes in front of selected notes.
    ; Shawn JR Bulen, 3/30/06
    ;

    ; prologue - prior to processing notes
    (do
    ; Key config info...
    (dword flamNoteDuration 120) ; Duration in ticks of inserted note...
    (int timeOffset -120) ; Offset from note to be doubled. Negative values place flam note prior to note.
    (int velOffset -20) ; Alter velocities by this amount. Negative values decrease velocity.

    ; User Prompts (if desired... otherwise comment 'em out...)
    (getWord flamNoteDuration "Duration of inserted note" 1 980)
    (getInt timeOffset "Time Offset" -960 960)
    (getInt velOffset "Velocity Offset" -127 127)

    ; Work fields...
    (dword evCount 0) ; Count of notes selected
    (dword evWorkTime 0) ;
    (int evWorkVel 0) ;

    ; Selected MIDI note info
    (dword evTime 0)
    (dword evChan 0)
    (dword evDur 0)
    (dword evKey 0)
    (dword evVel 0)
    )

    ; body - once per selected note
    (do
    (if (== Event.Kind NOTE) (do

    (= evTime Event.Time)
    (= evChan Event.Chan)
    (= evDur Note.Dur)
    (= evKey Note.Key)
    (= evVel Note.Vel)

    ; add velocity offset to note velocity
    (= evWorkVel (+ evVel velOffset))

    ; if valid, use new calc'd velocity
    (if (> evWorkVel 0) (do
    (= evVel evWorkVel)
    ))

    ; special test for negative offsets; don't let note start before 1:1:0
    (if (< timeOffset 0) (do

    (= evWorkTime (*= timeOffset -1))

    (if (> evTime evWorkTime) (do
    (= evWorkTime (+ evTime timeOffset))
    (insert evWorkTime evChan NOTE evKey evVel flamNoteDuration)
    (++ evCount)
    ))

    ) (do ; else positive value, no problem

    (= evWorkTime (+ evTime timeOffset))
    (insert evWorkTime evChan NOTE evKey evVel flamNoteDuration)
    (++ evCount)

    )) ; end of valid note time check

    )) ; end of "if note"
    )

    ; epilogue
    (do
    (pause "Number of Notes Inserted: " evCount)
    )


    post edited by shawnbulen - 2006/03/31 02:06:55
    #2
    mrmick
    Max Output Level: -90 dBFS
    • Total Posts : 6
    • Joined: 2006/03/30 08:46:12
    • Status: offline
    RE: Help needed for Grace note CAL Program 2006/03/31 12:18:24 (permalink)
    Shawn,

    Thanks a lot. I would never have been able to work that out. Much appreciated.

    Haven't tried it as of now, but I'm sure it'll do the biz.

    Didn't know I could do it the other way you mentioned, but using a CAL is easier.
    As said in this forum, don't know why Cakewalk dropped it.
    At least they could have replaced it with user recordable macros.


    Thanks

    Mick
    #3
    Jump to:
    © 2024 APG vNext Commercial Version 5.1