To diagnose what CC number and the value Cakewalk is getting from the pedal, while recording a midi track: hold down a note, press the pedal, let go of the note, then release the pedal.  Look at the event list.