Jump to content

Non CAL Legato


Craig Reeves

Recommended Posts

;; _Legato.CAL, by Serge Daigno 2003

(do
  (int tbase 1)      ; Or whatever you want, 2 for 480, 1 for 960
  (dword FromTime 0)
  (dword ToTime 0)
  (int Found 0)
  (int setting 1)         ; Or whatever you want, number of ticks cut before the next note

  (while (!= 4 Found)
  (do
    ;;  For each actual Note event occurence, get the Event.Time
    
    (= Found 0)

    (forEachEvent
    (do
      (if (&& (== Found 0) (&& (== Event.Kind NOTE) (> Event.Time FromTime)))
      (do
        (= FromTime Event.Time)
        (= Found 1)
      ))

      ;;  Find the next Note event occurence and get the Event.Time value

      (if (&& (== Found 1) (&& (== Event.Kind NOTE) (> Event.Time FromTime)))
      (do
        (= ToTime Event.Time)
        (= Found 2)
      ))
    ))

    ;;  Return to the actual Note event and resize the note duration
    
    (forEachEvent
    (do   
      (if (&& (== Found 2) (&& (== Event.Kind NOTE) (== Event.Time FromTime)))
      (do
         (= Note.Dur (- (/ (- ToTime FromTime) tbase) setting))
         (= Found 3)
      ))
    ))
    (if (< Found 3) (= Found 4)) ;; Ending when last note is reached
  ))
)

Link to comment
Share on other sites

7 hours ago, Craig Reeves said:

I've requested this before but the only MIDI legato is by running CAL, which is buggy and doesn't work very well. It's one of those features I really miss when coming back from Ableton.

Very good CALL! ;)

I wonder why isn't the obsolete CAL yet replaced with some more reliable and modern solution anyway?!

Link to comment
Share on other sites

  • 2 weeks later...
On 8/8/2021 at 6:11 PM, David Baay said:

I have often thought that the Bakers should go through all the old CALs, and convert them to native functions with corrected logic where necessary. Seems like low-hanging fruit. 

Yews - Lots of useful Cal functions that should be part of the DAW ! ☺️....hellooo humanise function !

Link to comment
Share on other sites

  • 2 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...