The first rule to remember and live by is: There are no wrong notes. This means what it says; you can play absolutely any note against any chord and be able to give a musical reason as to why that note is acceptable. Go now to the piano and play a C triad (C, E, G) with the left hand, and an F note in the right. It sounds discordant, right? Now play a little blues scale lick such as C, Eb, C, Eb, Gb, F, F, Eb. Now how about it? It works. Why? This is the next rule to live by...
Every note needs context. This means that, although there are indeed no wrong notes, there must always be a framework in which notes can be named and explained, given a value if you will. The F note above sounded discordant all alone with the C chord, but it was not a wrong note; once it was placed in a purposeful context, that of a little blues riff, an accompaniment to the Gb blues note (b5), and perhaps some rhythm added to the lick (melodic idea), it could be said that it (the F) becomes the most interesting note of all. Nice, right?
The third rule, which technically I should have written first but it's comfortable here, is: It don't mean a thing if ain't got that swing. The heart of jazz is its rhythm. You can play anything, but without rhythm, it means nothing at all. Developing rhythm can be difficult for beginners and I am certain that the only way you can develop a good sense of (jazz) rhythm is by LISTENING. Tap your foot on beat 2 and 4, and follow the bass player who, if very good, will highlight the rhythm immensely.
Check this out:
DO NOT READ ON UNTIL YOU HAVE ENJOYED THE VIDEO COMPLETELY! When Pedersen, Brown and Peterson are playing, you do not leave or talk. Pedersen is my favourite since he is more snappy. Can you feel the highlighted beats of 2 and 4 when they play walking bass? Go to 4.30 for Pedersen's bass line. It's scorching hot.
I'll discuss more now about notes, since it's difficult to write about feeling rhythm, you just need to develop that yourself by listening.
First of all, once you have internalised the two rules to live by as written above, I recommend the following (with my random example in brackets):
1. Pick a key - Eb
2. Pick 4 random notes (don't have to be in key) without playing them - F, B, D, C
3. Pick a chord based on the root of the key - Ebm7
4. Work out which 'note value' the random notes are in your key - 9th (will be nice), #5 (won't be), M7 (won't be), 13th (debatable) (not 6th because my chord has a dominant 7th)
5. Lay down (play) a steady 4/4 left hand rhythm with your selected chord and add the 4 notes in arpeggio style in whatever rhythm you want to see how they sound generally against the chord (all will be dreadful, or some will be dreadful, or you're lucky and all sound good).
At this point, you may recognise what happens when you try to improvise; these sometimes discordant sounds come out and you say "these are wrong notes, they don't work at all". Let me stop you there. Chromatic movement is very useful for getting out of difficult situations and allowing you to land on any other key without sounding 'plonky' (for foreign readers, I mean 'too direct and bland).
In my example, F is nice because it creates a m9 sound so I could could play this with my preferred rhythm for one bar. Great. B is the #5 so it clashes but, remember this: if one note really is discordant, then the next note won't be. This never fails. Let's highlight this bad note purposefully (always my key word) by alternating it with the Bb (not C, since that's already one of my random notes for use later). Now, the Bb is fine since it's part of the chord, the 5th, but this highlighting of the 'wrong note' just makes it sound more interesting because it has a context, a framework, a purpose, if you will. People listening will think "wow, that is a wrong note, but wait, he is playing it on purpose... clever, interesting... I like this guy).
The D will sound dreadful because it's a Major 7th against a dominant 7th, but so what? Let's play it and hold it down for a bar or two; let's say, the first bar (of 4 beats) we hold it down until the end of the bar, and in the second bar we play it on beat '2 and a half' and '3 and a half' but as staccato. This will be just 1 and a half beats before the new bar to play the C so let's fall to that chromatically from the C# between the two notes. Once the C has been played how you want, the melody would then break away from this Ebm and go elsewhere. Of course, the idea is that you would continue with this way of thinking throughout the song.
In conclusion, I recommend discovering 'wrong' notes (in terms of note value, so you can find them in any other key quickly), and finding ways to highlight them to make them 'wrong but purposeful and interesting' notes. Find a few notes as a group and play on top of a chord (or two). This will help you build a 'bag of licks' as well as increase your confidence when improvising since brain power will not be wasted on trying to avoid notes that you think will not work.