II've just had a look at the downloadable manual for the Yamaha P-105, amd I suspect you may be a little confused. Please forgive me if I state the obvious, but it's usually better to say more than mecessary than less.
1. The USB socket is what Yamaha call a "to host" socket. It only handles two things. One is MIDI data and the other is you van transfer "songs" from the Yamaha's internal memory to a computer for storage.
2. MIDI is not audio and audio is not MIDI. MIDI is instructions that tell a device, in this case a P-105, what to do. Which notes to play and when, how loudly to play them and so on. The P-105 then plays whatever those instructions tell it to and audio comes out. It's a bit like the old player-pianos that had a long paper roll with holes in it which told them what to play. MIDI is the holed in the paper, not sound.
3. To get MIDI in and out of the keyboard connect it to a USB socket on the PC. You will also need to load the Yamaha drivers to do this. They appear to be available here -
http://usa.yamaha.com/pro...pianos/p_series/p-105/4. Once the Yamaha drivers are installed and the keyboard connected it should show up as a MIDI port in Sonar's preferences. Enable both thenin and out ports. While you are there disable the Microsoft synth's ports in Sonar. That MS synth is only there as a last resort for old games and multimedia stuff which used MIDI files rather than background audio so needed a General MIDI (GM) compliant synth to be available. The MS one is rubbish, and if you need the GM sounds for any reason Sinar has TTS-1 which is much, much better.
5. Uninstall ASIO4ALL. It is a hack written in the hope it might fool Windows into thinking the on-board PC sound has ASIO drivers. ASIO drivers give much, much less latency than the standard Windows ones but most PC built-in soundchips don't have them, so if you are stuck with on-board sound ASIO4ALL can be worth trying. It is very difficult to optimally configure, often doesn't work very well and is worse than any ASIO driver provided by an an ASIO interface manufacturer.
Like the MS synth it's a final fall-back when nothing else is available. Unfortunately you will find some posts on some general audio-related forums claiming ASIO4ALL is the greatest and best in all circumstances. That's like saying if your car brakes fail, you can stop the car by driving into a tree - so even when the brakes are working fine when you want to stop don't press the brake pedal, just run into that tree instead.
So. Download the latest drivers for your interface and install them. If you select ASIO as the driver mode in Sonar's preferences you should then find the ins and outs on the interface are available.
6. Connect the keyboard audio outputs to a pair of line inputs on the interface. Connect speakers to the interface outputs.
7. Turn up the keyboard volume until your loudest playing is getting near, but not in, the red on the interface.
8. Set up a fresh blank project in Sonar. Create one audio track and one MIDI track. Set the input of the audio track to be whatever inputs on the interface the piano is connected to. Arm the track for recording and, with any luck, when you play you should see the track meter respond. The track output should point at the master bus which in turn outputs to the hardware. Sonar usually gets that right by default.
You should now be able to record and play back audio.
9. MIDI. Here's where things get a bit more complicated.
The input of the MIDI track should be set to the port that Sonar receives MIDI from the keyboard on. If you arm that track for record and play you should see the track meter respond. You can now record your performance as MIDI data.
To play the MIDI data back from the keyboard you need to point the MIDI track output at the keyboard's other MIDI port, to start with set the channel as "omni". Then, when you play the MIDI track, the keyboard should play the notes. If you want to overdub MIDI into that track be aware you may hear the notes twice or get a kind of flanging. This is because the keyboard plays the note when you press a key then plays it again a few milliseconds later when Sonar echos the MIDI back to it. To stop this either disable the MIDI track's echo function or, better, set the keyboard to what is called "local off". "Local off" means the keyboard doesn't play when you press the key but only responds to the MIDI coming back into it from Sonar.
Local off is very useful if you want to use the piano to play another synth, either a software one or hardware. To use a software synth load one in Sonar then set up a MIDI track as above with the input the piano and the output the software synth.
With any luck that will help you get started. There are other things to deal with, like you'll probably still have some latency problems to start with so long as you use a decent audio interface and ASIO drivers things can usually be tweaked until they work. There's also things like MIDI channels, but, again, let's go one step at a time.
If you need an introduction to MIDI Sound on Sound have a series of very good articles which start here -
https://www.soundonsound....aug95/midibasics1.htmlThe articles are old, but as useful today as they were when written. MIDI is one of those things that were got so right in the first place that there haven't been many changes and the things that have changed have been to expand it a bit not change the first principles.
It's also worth reading the MIDI related parts of the keyboard manual and downloading it's MIDI spec document from Yamaha (same place as the drivers), as every hardware instrument handles MIDI a bit differently and has peculiarities of its own.
Finally, if you don't understand or something doesn't work, never be afraid to ask. We all had to start somewhere, none of us were born knowing this stuff and there's a wealth of good advice and information to be had from this forum.