I had ChatGPT help me write this CAL script to convert drum loop MIDI files from the general midi (GM) map to the addictive drums 2 (AD2). I hope it helps anyone else looking to do the same thing.
Here is the code in case you want to see it.
; GM_to_AD2_if_chain.cal
; Minimal GM -> AD2 remapper using core CAL syntax only.
(do
; --- duplicate-collision tracker for 1-tick nudge (optional) ---
(int lastTime)
(int lastNote)
(int lastChan)
lastTime -999999)
lastNote -1)
lastChan -1)
(forEachEvent
(if (== Event.Kind NOTE)
(do
; ---- REMAP CHAIN ----
Note.Key
(if (== Note.Key 46) 54 ; Open Hi-Hat
(if (== Note.Key 42) 49 ; Closed Hi-Hat
(if (== Note.Key 44) 48 ; Pedal Hi-Hat
(if (== Note.Key 36) 36 ; Kick
(if (== Note.Key 38) 38 ; Snare (center) - unchanged
(if (== Note.Key 37) 42 ; Rimshot / SideStick
(if (== Note.Key 40) 41 ; Snare (rim)
(if (== Note.Key 48) 71 ; Tom 1 (High)
(if (== Note.Key 47) 69 ; Tom 2
(if (== Note.Key 45) 67 ; Tom 3 (Low)
(if (== Note.Key 43) 65 ; Tom 4 (Floor)
(if (== Note.Key 49) 77 ; Crash 1
(if (== Note.Key 57) 79 ; Crash 2
(if (== Note.Key 55) 81 ; Splash
(if (== Note.Key 52) 89 ; China
(if (== Note.Key 51) 60 ; Ride
(if (== Note.Key 59) 84 ; Ride 2
(if (== Note.Key 53) 61 ; Ride Bell
(if (== Note.Key 39) 41 ; Hand Clap
Note.Key ; else: leave unchanged
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
; ---- 1-tick nudge if exact duplicate lands on same tick & channel ----
(if (== Event.Time lastTime)
(if (== Note.Key lastNote)
(if (== Event.Chan lastChan)
Event.Time (+ Event.Time 1))
)
)
)
lastTime Event.Time)
lastNote Note.Key)
lastChan Event.Chan)
)
)
)
)
Drums GM to AD2.CAL