Thanks for the help! I just went to preferences/midi/playback and recording. I didn't see any option to make sure controllers are recorded. Next, I tried switching my sustain pedal/button on and off while recording. Interestingly, it worked. So, I can't begin a recording with sustain, I have to add sustain while recording. Is there a way to begin the recording with sustain? Why does Sonar start the recording without sustain (even though I can hear the sustain through my monitors)?
ADDED: I'm not sure if this is a separate or related problem, but I am noticing a lot of distorted/crackling/hissing noises when I play my keyboard. I'm using a simple instrument track with the Cakewalk Sound Center. Also, sometimes when I add a new simple instrument track, I get a loud beep and then a message that says my audio engine has been dropped. Usually this doesn't happen, but it does every once in a while. My computer is 64 bit, but sonar says the sound center is 32 bit, could this have something to do with the problem?