There is a 32 bit soft synth called Beatscape that allows you to trigger loops with midi events.
Alternatively, you can also use Matrix View which kinda replaced Beatscape. I don't know the last version of Sonar that Beatscape shipped with. X1 maybe? Not sure.
I don't think the loop follows the tone though. It would just be triggered by the tone. In other words, the pitch would not shift with the key you use to trigger it.
Alternatively, you can create an arpeggio pattern.
http://www.cakewalk.com/Documentation/default.aspx?Doc=SONAR%20X2&Lang=EN&Req=Recording.19.html If you trigger a tone with your midi controller (keyboard) and hold it, you can loop an arp pattern you create and have the pattern root on the note you are playing. Now, this isn't perfect because it doesn't adjust the pattern depending on what chord in the key you are on, but it's kinda similar.
Now in this case, the midi pattern will be the same in all cases, but the pitch will root on the key you use to trigger the arp.
For composing songs, you might investigate Matrix View. It's really designed just for that sort of thing...
http://www.cakewalk.com/Documentation/default.aspx?Doc=SONAR%20X2&Lang=EN&Req=Views.44.html
post edited by gswitz - 2014/02/22 17:41:29