You are on page 1of 2

Velocity mdifier CAL scriipt for Sonar/Cakewalk users by A.

Eist
File velocity-modifier32x.cal
; CAL script for Cakewalk users make the Live music
; version values 16x2 included switch32.inc
; Application is the modificator of the sound's velocity with pseudo random numbers
sequence -
; harmonically placed all the power of sounds according with force of it's pic
; Author Alexander Eist http://c-europe.eu 2020
;
(do
(int debug TRUE)
(int v 1) ; v - value to be decremented volume
(int k 1) ; k - koefficient for decrement volume
(int max_val 100) ;
(int m_in 0) ; number in sequence
(dword m_pics (* TIMEBASE 4) ) ; pics in one measure
; temporary variables
(dword pics_in_sixteen (/ TIMEBASE 4) )
(int location 0) ; number of sixteen from "FROM"
(int prevmeas 0) ; used for status display
(int percent 0) ; delta percent
(dword offtime 0) ; time distance from "From"
(int roughper 0)
(int track (GetCurrentTrack)) ;
(dword timedif (- Thru From)) ; delta time
(getInt k "Select koefficient" 1 5)
(getInt max_val "Max Value?" 100 127)
(if (== debug TRUE)
(do
(pause "track" track "Thru " Thru " offtime " offtime " measures " (meas Thru))
)

)
; (include "switch32.inc")
;-----------------------------------------------------------------------------
(if (== Event.Kind NOTE) ;if1
(do ; do 2
(pause "24 Note.Key" Note.Key)
(= offtime (- Event.Time From)) ; difference from FROM
(= location (/ (- offtime (* m_in m_pics)) pics_in_sixteen)) ;
(pause "location" location)
(if (> location 31)
(do
(++ m_in)
(= location 0)
(pause "m_in" m_in "\nlocation:" location "\nofftime: " offtime)
)
; else
)
(include "switch32.inc") ; switch location...
(= Note.Vel (- max_val (* v k)))
; display status
(if (!= (meas Event.Time) prevmeas) ; if 3
(do ; then part if3
(= prevmeas (meas Event.Time))
(message "Current Measure: " prevmeas)
)
) ; else part if 3
) ; end do2
) ; end if 1
) ; end do 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

file switch32.inc
(switch location
0 (= v 1)
1 (= v 9)
2 (= v 5)
3 (= v 13)
4 (= v 3)
5 (= v 11)
6 (= v 7)
7 (= v 15)
8 (= v 2)
9 (= v 10)
10 (= v 6)
11 (= v 14)
12 (= v 4)
13 (= v 12)
14 (= v 8)
15 (= v 16)
16 (= v 1)
17 (= v 9)
18 (= v 5)
19 (= v 13)
20 (= v 3)
21 (= v 11)
22 (= v 7)
23 (= v 15)
24 (= v 2)
25 (= v 10)
26 (= v 6)
27 (= v 14)
28 (= v 4)
29 (= v 12)
30 (= v 8)
31 (= v 16)

location (= v 1) ;Catches any event types that we don't know about.

)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

You might also like