yeah well that's it then. randomly slapping notes here and there can give results but everything goes a lot easier when you know something about chords and scales. I've played guitar years back and all i can say it really helps.
Sampling can be problematic too, because you generally dont know what note the source is played from. so when you play a base C from a sample, it can actually be something completely different and soforth not sit in with your bass or other melodic elements.
Well i'm just rambling when all i wanted to say was to learn some music theory.
I agree with Kama. Learning basic music theory is the way to go. I'd recommend going to a library and getting one of those "learn how to play piano in X number of days/weeks" books. You don't need to read the whole thing, just skip to the bits about scales and chords and you'll be away laughing. Of course, onc eyou've learned your scales and chords you can then mess around with them by augmenting or diminishing notes within a scale to give you that slightly discordant sound.
That will give you the basics. Start with "How to construct major and minor piano scales" then move on to "How to form major and minor piano chords". Remember, music theory might be boring but it will help you make better tunes in future!
Definitely music theory is the way forward, working out those sweet chords is the key to making a phat bassline and a catchy hook. After you know something about chords, you need to work on getting the hooks spot-on, because the hook is the part of the tune that stands out the most. then use your chord knowledge to make a bassline that complements the hook and makes the track shine. Or the other way around, first a phat bassline, and then a catchy hook to complement.