#1
When improvising, such as while jamming with some friends or band or something, do the notes come into your head (you can actually hear it in your head ) and you quickly translate it onto your guitar or bass or do you just kind of wing it and hit some notes and hope it sounds good?

Example 1

You are playing a chord progression and want to add a little fill or variety to it. You think of something in your head and then you know exactly what to play and it goes well with it.

or

Example 2

Same thing as above, chord progression and want to add a fill. You cant really think of anything but you hit a few notes and sometimes it sounds good with the progression other times it sounds bad. I dont mean just throwing in random notes. I mean throwing in notes that are around the rest of the notes you are playing; notes that you know go well with the other notes but you occasionally add in an experimental note that may or may not flow. (I hope that made sense)

This is kind of a weird question but I am just curious to how improvising works. I started playing bass about a month ago (guitar for more than 2 years) and I have been listening to a lot of flea's bass lines and a lot of it is improvisation and ive always wondered. "When Flea adds in a little fill to his riff does he know what he plans on playing (he can hear the fill in his head and says hey that sounds cool and throws it in) or does he just move his fingers with some notes and it just sounds good.

Just curious. I personally sort of throw in stuff, most of the time it will sound fine but every once in a while I get a really nasty sounding fill and I hope no one hears it lol.
#2
most good guitarists/bassist know how the scale sounds, so yes they can play what they hear in their head, some people just play random scale notes or any random notes and they sound good.
so yes, both ways are right
gear:
Charvel 750XL w/ Duncan SH15
Squier Affinity HSS strat
Orange Tiny Terror Combo
Yamaha RBX 170 bass
Roland Micro Cube
EHX Big Muff Tone Wicker
EHX Stereo Electric Mistress
Hardwire Delay
Vox V-847A Wah
Artec Dual Boost
Boss EQ
#3
To me, it depends on how comfortable i am with music theory. Knowing which scales are useable over different chords helps a lot. It enables you to see a patern on your fretboard of notes you can use. But i mostly have something in my head that i try to play along to, or else it will just be walking up and down scales. But they can be a good failsafe.

The Only Thing I Fear,
Is Running out of Beer..
#4
Depends how comfortable I am with what I'm using. Minor pentatonic I play what I hear in my head - pretty much anyway. Minor/major scales its kind of a mixture of playing what I hear, misplaying what I hear (lol) and playing random notes, arpeggios I'm definitely still at the random notes stage - unfortunately it just sounds like I'm playing random notes too at the moment lol