MIDI is a standard system for recording all parameters of a musical performance without storing the audio itself. When played back, MIDI data tells a synthesizer what notes to play, when, how long and how loud. Velocity data stores how hard a note is played, and this is determined by the performer. MIDI volume controls the overall level of a MIDI track, preserving the level of velocity data. Both use a scale from 0 to 127. Let velocity data fall naturally with the performer and set volume around 100.
The audio output of a MIDI device can now be treated the same way as a guitar or microphone input. Assuming you're using a mixer feeding SONAR through an audio interface, each sound source, or channel, has its gain levels similarly adjusted. Set the gain control at the top of a channel strip fully counterclockwise. Set the linear fader for that channel to the 0 position, then turn the gain control clockwise until you have a reasonable signal that does not distort or peak.
Within SONAR, use Console View to adjust individual channels by way of the onscreen faders. Generally you'll reduce from 0 only, but you have room to boost signals if required. MIDI channels can have both velocity and volume data changed or edited within the program as well. Dynamic changes to sound levels through a performance can be automated by the use of volume envelopes. By drawing lines on both MIDI and audio tracks, you can make repeatable level changes, which is handy for performing mixes.
After mixing a project down to a stereo track within SONAR, you can alter the effective level of the mix with compression and limiting. Recent versions of SONAR include an audio plug-in called Boost 11 to accomplish this. Add Boost 11 as an effect to your mix track and adjust the two controls, "Boost" and "Output," until you have a loudness effect on your mix that doesn't distort.