That seems too involved. With samples, it's not as about matching the Key of a sample (which is very difficult to try and determine with multi-sound/multi-instrument samples) as much as it is about simply just trying to match/blend mood, feeling, and sonic texture.
With regards to bass lines, (which I too found difficulty with at first), I approach it in two ways. When I'm doing bass lines with samples, 99% of the time I try to extract a bass frequency from somewhere within the main sample that I'm using. I use the filtered "framework" of the main sample, that is, a duplicate of the sample, but only low frequency. From here, I either use this filtered duplicate at the exact pitch and length of the main sample, or I chop it up into pieces and arrange it over 4 to 8 different MPC pads. Then I just "match" (dare I say play) the bass chops to the feel of the beat, using the main sample as my guide. If and when these bass chops lack sonic presence (umph), I layer in first generation sounds (live keyboard/synth) at strategic points in the arrangement. This adds depth to initial bass arrangement that I've worked in.
When I use bass lines in keyboard beats, I just focus on the anchor point or anchor sound. Before I knew anything about music theory, (I'm learning more), I knew bass lines and melody depended upon an anchor point, or rather an anchor sound, and my ability to progress up or down from that anchor in a pattern that fit whatever beat I was working on. Now I've learned that in Western music theory, this is actually known as simply using scales. Scales are a progression of single notes upwards or downwards in steps. They are defined by their starting point/step, or more precise, their starting note...
So what I do is I keep in mind that a standard bass guitar has 5 strings. Therefore, I only work with 2 to 5 notes. When I trigger bass sounds from reason, I arrange one bass sound over 16 pads. Then I pick out what I now call a "scale area" to work with. A scale area to me is just any 2 to 5 sounds/notes (pads) not necessarily ascending/descending, but agreeable to the theme of the beat that I'm working on. From here, I kind of give each sound (pad) a number, then I play some simple patterns like: 1-2-3...3-2-1...
After I get a feel for the possibilities, you know for what might I work, I get a little more advanced with it, something like: 1-2-3 3-3 2-3-3-3-4, 1, then loop. Now, knowing notes (A, B, C, etc.) certainly helps. But my lack of that sort of "traditional knowledge" forced me to compensate by coming up with own parallel system...
Bottom line: what I do is I pick the bass patch (sound) that I want to work with, then I sample or use it as is, then I duplicate it or assign it over 2 to 5 pads or keys. I start with a simple up or down 1-2-3...3-2-1. This gives me an idea about what pitch is working. After I determine the right pitch, I lay down a simple pattern, using the drums as my guide. Then after I've recorded and looped that, I lay down another simple pattern based on/playing off of the first simple pattern I laid down... Another thing that I do after this is I solo the bass part and then sample it. This allows me to then assign the entire bass part to just one pad. More importantly, it allows me to store that bass pattern to be used as part of a new beat later...