CAL Question

Author
rgturner
Max Output Level: -89 dBFS
  • Total Posts : 81
  • Joined: 2006/04/01 10:45:40
  • Status: offline
2015/11/27 03:01:37 (permalink)

CAL Question

Can anyone show me an example of how to use the TrackVolume command?  I'm trying to write a CAL that excepts a single parameter; the Volume.  Then the script should loop through each track and set the volume to the volume entered.
 
Can anyone show me a script that can do this?
#1

6 Replies Related Threads

    promidi
    Max Output Level: -66 dBFS
    • Total Posts : 1220
    • Joined: 2014/11/21 18:46:39
    • Location: South Australia
    • Status: offline
    Re: CAL Question 2015/11/28 04:58:31 (permalink)
    rgturner
    Can anyone show me an example of how to use the TrackVolume command?  I'm trying to write a CAL that excepts a single parameter; the Volume.  Then the script should loop through each track and set the volume to the volume entered.
     
    Can anyone show me a script that can do this?



    Here is a quick script I wrote a little while back to do just that. 

    ;

    (do
        (int Trackno 0)
        (int Volume 127)
        (getInt Volume "Please enter initial volume " 1 127)
         (while (< Trackno 256)
            (do
                 (TrackVolume Volume Trackno )
                 (++ Trackno)
            )
         )
    )

    Windows 10 64bit fully patched, 16 gig ram . 
    PCR-800 Controller.  (Working in Win 10 1809 64bit)
    CPU: i5 4670. 
    Video: Nvidia GTX560ti (latest drivers).
    Audio IF: Focusrite 2i2 2nd Gen

    Internet always on.

    Software
    : Cakewalk by Bandlab (2018.09 B29)
    ASIO mode. 24bit 48khz 256 samples 
    Rapture Pro, AAS GS2, VS-3, EP-4, VA-2, Chromophone 2, Z3TA+ 2, Addictive drums 2, Addictive Keys, Mpowersynth (latest), Iris 2, GPO5, Sampletank 3,
    #2
    rgturner
    Max Output Level: -89 dBFS
    • Total Posts : 81
    • Joined: 2006/04/01 10:45:40
    • Status: offline
    Re: CAL Question 2015/11/28 19:11:25 (permalink)
    Cool!   Thanks!
    #3
    rgturner
    Max Output Level: -89 dBFS
    • Total Posts : 81
    • Joined: 2006/04/01 10:45:40
    • Status: offline
    Re: CAL Question 2015/11/28 20:16:34 (permalink)
    Dumb Question.  This will set the volume to a value between 1 & 127. Could this be converted to allow values such 0, -6, -36?
     
    I imagine this would required some formula to convert the input value of 6 (for example) to 127
    #4
    rgturner
    Max Output Level: -89 dBFS
    • Total Posts : 81
    • Joined: 2006/04/01 10:45:40
    • Status: offline
    Re: CAL Question 2015/11/28 20:19:36 (permalink)
    Here's what I have. 
     
    Instead of the switch I'd like to use a formula to determine the CalculatedVolume.  Any ideas?
     
    Any mathematicians out there?
     
    (do
     (include "need20.cal") ; Require version 2.0 or higher of CAL
      
      (int Trackno 0)
      (int Volume -3)
      (int CalculatedVolume)
       
      (getInt Volume "Please enter initial volume " -12 6)
     
      (switch Volume
      6 (= CalculatedVolume 127)
      0 (= CalculatedVolume 101)
      -3 (= CalculatedVolume 88)
      -6 (= CalculatedVolume 75)
      -12 (= CalculatedVolume 53)
     )
     
      (while (< Trackno 256)
       (do
         (TrackVolume CalculatedVolume Trackno )
          (++ Trackno)
       )
     )
    )  
    #5
    promidi
    Max Output Level: -66 dBFS
    • Total Posts : 1220
    • Joined: 2014/11/21 18:46:39
    • Location: South Australia
    • Status: offline
    Re: CAL Question 2015/11/28 22:21:08 (permalink)
    rgturner
    Here's what I have. 
     
    Instead of the switch I'd like to use a formula to determine the CalculatedVolume.  Any ideas?
     
    (switch Volume
     6 (= CalculatedVolume 127)
     0 (= CalculatedVolume 101)
     -3 (= CalculatedVolume 88)
     -6 (= CalculatedVolume 75)
     -12 (= CalculatedVolume 53)
    )


    The closest formula you are after is CalculatedVolume = 4.1333333 x (entered volume) + 101.2 with a correlation coefficient (or fit) of 99.91%    As Cal only deals in whole numbers, the results will be a tiny a bit off, but should be close enough for your purpose

    Here is the new script

    (do
        (int Trackno 0)
        (int Volume 6)
        (getInt Volume "Please enter initial volume between -12 and 6" -12 6)
        (*= Volume  4)
        (+= Volume  101)
        (while (< Trackno 256)
            (do
                 (TrackVolume Volume Trackno )
                 (++ Trackno)
            )
         )
    )

    Windows 10 64bit fully patched, 16 gig ram . 
    PCR-800 Controller.  (Working in Win 10 1809 64bit)
    CPU: i5 4670. 
    Video: Nvidia GTX560ti (latest drivers).
    Audio IF: Focusrite 2i2 2nd Gen

    Internet always on.

    Software
    : Cakewalk by Bandlab (2018.09 B29)
    ASIO mode. 24bit 48khz 256 samples 
    Rapture Pro, AAS GS2, VS-3, EP-4, VA-2, Chromophone 2, Z3TA+ 2, Addictive drums 2, Addictive Keys, Mpowersynth (latest), Iris 2, GPO5, Sampletank 3,
    #6
    rgturner
    Max Output Level: -89 dBFS
    • Total Posts : 81
    • Joined: 2006/04/01 10:45:40
    • Status: offline
    Re: CAL Question 2015/11/29 00:16:54 (permalink)
    Thanks!  This has been quite helpful.  Not a lot of documentation available.
    #7
    Jump to:
    © 2024 APG vNext Commercial Version 5.1