CAL script to counteract 'true legato' note lags in Kontakt?

Author
williamcopper
Max Output Level: -68 dBFS
  • Total Posts : 1120
  • Joined: 2014/11/03 09:22:03
  • Location: Virginia, USA
  • Status: offline
2015/01/05 16:15:39 (permalink)

CAL script to counteract 'true legato' note lags in Kontakt?

As more sample producers introduce legato, they are introducing serious delays for note transitions, enough that rhythmic passages get distorted.   Anyone written a CAL script to shift note-on midi messages earlier when they are close enough to the following note to trigger legato? 
#1

5 Replies Related Threads

    robert_e_bone
    Moderator
    • Total Posts : 8968
    • Joined: 2007/12/26 22:09:28
    • Location: Palatine, IL
    • Status: offline
    Re: CAL script to counteract 'true legato' note lags in Kontakt? 2015/01/06 10:17:03 (permalink)
    If I accidentally cause two separate notes to sound as one long one, due to the 1st note running too close to the 2nd, I manually change the duration of the 1st note to be a tad shorter, and that always fixes the issue for me.  (I hope I understood your issue properly)
     
    How often are you experiencing problems with this?
     
    Bob Bone
     

    Wisdom is a giant accumulation of "DOH!"
     
    Sonar: Platinum (x64), X3 (x64) 
    Audio Interfaces: AudioBox 1818VSL, Steinberg UR-22
    Computers: 1) i7-2600 k, 32 GB RAM, Windows 8.1 Pro x64 & 2) AMD A-10 7850 32 GB RAM Windows 10 Pro x64
    Soft Synths: NI Komplete 8 Ultimate, Arturia V Collection, many others
    MIDI Controllers: M-Audio Axiom Pro 61, Keystation 88es
    Settings: 24-Bit, Sample Rate 48k, ASIO Buffer Size 128, Total Round Trip Latency 9.7 ms  
    #2
    dcumpian
    Max Output Level: -34 dBFS
    • Total Posts : 4124
    • Joined: 2005/11/03 15:50:51
    • Status: offline
    Re: CAL script to counteract 'true legato' note lags in Kontakt? 2015/01/06 15:37:27 (permalink)
    Hey Bob,
     
    No, the OP is wanting to keep the note overlaps, only move the start times of the subsequent notes slightly earlier to give the legato transitions time to play. Without doing this, the instrument can sound like it is playing late because of the time it takes for the legato transition to play. I find that I have to do the same thing on many instruments with "true legato".
     
    Having said that, I don't know of a CAL script that would do this and, quite frankly, the legato transitions vary depending on how the instrument is being played (fast/slow and hard/soft). I usually end up tweaking every note by hand.
     
    Regards,
    Dan
     

    Mixing is all about control.
     
    My music:
    http://dancumpian.bandcamp.com/ or https://soundcloud.com/dcumpian Studiocat Advanced Studio DAW (Intel i5 3550 @ 3.7GHz, Z77 motherboard, 16GB Ram, lots of HDDs), Sonar Plat, Mackie 1604, PreSonus Audiobox 44VSL, ESI 4x4 Midi Interface, Ibanez Bass, Custom Fender Mexi-Strat, NI S88, Roland JV-2080 & MDB-1, Komplete, Omnisphere, Lots o' plugins.    
    #3
    robert_e_bone
    Moderator
    • Total Posts : 8968
    • Joined: 2007/12/26 22:09:28
    • Location: Palatine, IL
    • Status: offline
    Re: CAL script to counteract 'true legato' note lags in Kontakt? 2015/01/06 18:36:31 (permalink)
    Aah - thanks for the explanation - yeah, I don't know of a any sort of automated way of dealing with that.
     
    Bob Bone
     

    Wisdom is a giant accumulation of "DOH!"
     
    Sonar: Platinum (x64), X3 (x64) 
    Audio Interfaces: AudioBox 1818VSL, Steinberg UR-22
    Computers: 1) i7-2600 k, 32 GB RAM, Windows 8.1 Pro x64 & 2) AMD A-10 7850 32 GB RAM Windows 10 Pro x64
    Soft Synths: NI Komplete 8 Ultimate, Arturia V Collection, many others
    MIDI Controllers: M-Audio Axiom Pro 61, Keystation 88es
    Settings: 24-Bit, Sample Rate 48k, ASIO Buffer Size 128, Total Round Trip Latency 9.7 ms  
    #4
    williamcopper
    Max Output Level: -68 dBFS
    • Total Posts : 1120
    • Joined: 2014/11/03 09:22:03
    • Location: Virginia, USA
    • Status: offline
    Re: CAL script to counteract 'true legato' note lags in Kontakt? 2015/01/06 20:00:57 (permalink)
    Yes, Dan has it right.   I'm working on a cal script.  I have not seen any new CAL reference material in about 15 years, so if anyone knows of some please say so.   Things like how to refer to system midi messages (like tempo) are still mysteries.
     
    #5
    williamcopper
    Max Output Level: -68 dBFS
    • Total Posts : 1120
    • Joined: 2014/11/03 09:22:03
    • Location: Virginia, USA
    • Status: offline
    Re: CAL script to counteract 'true legato' note lags in Kontakt? 2015/01/06 20:13:36 (permalink)
    Here's a draft version.  Improvements welcome!   There are a few to-be-deleted announcements for debugging.  This one is special purpose in that it also adds keyswitch notes for legato as done by VSL solo and chamber strings for Gigagstudio ... your own legato patches will need whatever special keyswitch notes there should be. 
     
    ;;;SET_LEGATO.CAL
    ;;;BY William Copper
    ;;;
    ;;;Add legato key-switch notes and adjust note start times
    ;;;and duration and previous note duration.
    ;;;

    ;;; Prolog
    (do

       (int notecount 0) ;; count of all notes processed
       (int kscount 0)   ;; count of keyswitches added

       (int note_num 0 )  ;; from each note event
       (int note_vel 0 )  ;; from each note event
       (int note_chan 0) ;; current key channel
       (dword note_time 0 ) ;; "
       (dword note_dur  0 ) ;; "
       (dword note_end  0 ) ;; each note event end time = note_time + note_dur

       (int keybase 24) ;; base keyswitch note (24=C1 at -1 octave setting)
                        ;; adjust as necessary for another global octave setting
       (int keymax 12) ;; max keyswitch delta (12=octave)
       (int key_interval 0) ;; delta to be added to keybase for keyswitch note
       (int key_abs 0 )     ;; absolute value of key interval
       (int key_note )   ;; new keyswitch note
       (int prev_note_num 0 ) ;; previous key note

       (dword ks_time       0) ;; insert time for new key switch
       (dword new_time      0) ;; insert time for replacement note
       (dword prev_note_dur 0) ;; previous note duration
       (dword prev_note_end 0) ;; previous note end time
       (dword legato_time 200) ;; discernment interval between end of previous note
                         ;; and start of next note
       (dword legato_setback 20) ;; shift back in ticks for new legato start time
       (getInt keybase "Keyswitch base note (24=C1 at -1 octave): " 0 127)
       (getInt keymax  "Keyswitch maximum (12=octave, 24 max) : " 0 24 )
       (getInt legato_time "Legato time interval minimum (4000 max): " 0 4000)
       (getInt legato_setback "Legato time setback interval (480 max): " 0 480 )

    )

    ;;; Body
    (do

       (if (== Event.Kind NOTE)
          (do
             (= note_num    Note.Key )
             (= note_chan   Event.Chan )
             (= note_vel    Note.Vel )
             (= note_time   Event.Time )
             (= note_dur    Note.Dur )
             (= note_end    (+ note_time note_dur ))
             (+= notecount 1 )

             (= new_time (- note_time legato_setback ) )
             (= ks_time (- new_time 3 ))

             ;; test for interval vs legato_time

             (if (>= legato_time (- note_time prev_note_end) )
                (do  
                   (+= kscount 1 )
                   (= key_interval (- note_num prev_note_num) )
               (pause "added ks "  kscount " for interval " key_interval )

                   ;; get absolute value of key interval for test
                   (if (> 0 key_interval ) (= key_abs (- 0 key_interval )))

                   (if (>= keymax key_abs)
                       (= key_note (+ keybase key_interval))
                   ;;else
                       (= key_note keybase)
                   ) ;;end if


                   ;;test for negative time value
                   (if (<= 0 (- note_time legato_setback))
                     (do
                        (delete)
                        ;; insert keyswitch velocity 1, duration 1 3 ticks earlier
                        (insert ks_time note_chan NOTE key_note 1 1 )
                        (insert new_time note_chan NOTE note_num
                               note_vel note_dur )
                     ) ;; end do
                   ) ;; end if
                 )  ;;end do
              ;; else
                 (do
                    (delete)
                    (insert new_time note_chan NOTE note_num note_vel
                         (- note_dur legato_setback) )
                    (insert ks_time note_chan NOTE keybase 1 1 ) ;; (non legato note)
                 )
              )
            (= prev_note_end note_end)
            (= prev_note_dur note_dur)
            (= prev_note_num note_num)
          )
       ) ;; else do nothing
    )
               
    ;;; Epilog
    (do
        (pause "Note count " notecount " Keyswitch count " kscount )
    )


    #6
    Jump to:
    © 2025 APG vNext Commercial Version 5.1