Building Walking Bass Lines by Ed Friedland is an excellent book on how to construct bass lines. Plus Ed checks into this forum from time to time. You could catch him with questions at this post
Building Walking Basslines Lesson 1
Surprisingly Bass Guitar for Dummies has a good segment on building grooves which explains which bass lines lend themselves to grooves. What I got from this book is if the bass line (pattern) is generic - can be used over all the chords in the progression - it's easy to take those bass lines into a groove. If we have to worry with what we are doing next the groove never seems to develop.
All chords have a root, so roots are generic.
All basic chords have a 5 so 5's are generic.
The 8 is a root at another octave so 8's are generic.
The 6 is neutral so will fit into a generic bass line.
The 2 and 4 make good passing notes, just do not land on them.
So, 3's and 7's are not generic. They have a specific job to do.
R-R-R-R is generic and a snap to develop into a groove. So is....
R-5-R-5 or R-5-8-5 or R-R- you get the picture take it from here.
This book will give you what you need to write melodies.
http://books.google.com/books?id=Hty...page&q&f=false Wade through the first 30 pages, pay attention to three close notes then a leap -- it's what you do after the leap that is interesting. Pauses are important let the melody breath.
This site talks about what is necessary to improvise a melody.
http://www.youtube.com/watch?v=NehOx...eature=channel
If you were talking about improvising a bass line I think what Bass Guitar for Dummies has to say will be time well spent. Ed's book will give you many examples of what can be used.
You don't need hundreds of bass lines. Couple generic major chord bass lines and a couple of generic minor chord bass lines and then something in muscle memory for when you see F#m7b5 -- (a diminished chord) and R-b3-b5-b7 is the chord spelling for any diminished chord.
My generic major bass line revolves around R-2-5-6 or R-3-5-8.
My minor generic bass line revolves around R-2-5-b7 or R-b3-5-b3.
Pick some you like and then get them into
muscle memory and be able to use them with any Major or minor cord that comes up in the progression.
Good luck.