What do chord symbols have to do with melody?
Chord Symbols and Melody share a Common Cause
I see chord symbols on each bar, and I assume they represent the notes in the bar [...] If [chord symbols] are a vague representation of the notes inside, [...]
Ah, so let me challenge that: the chord symbols aren't actually trying to match the melody. Rather, the chord symbols describe the entire harmony, and the melody is kind of its own separate thing that usually happens to be mostly contained by the chord symbol. Let me explain that a little better.
It's not a One-to-One Relationship, Either
Music is subjective, so there aren't any "right answers" here for what chord goes with what melody. That doesn't mean that there's no pattern, but it does mean that the patterns are associations and not rules. If you take a melody out of context, you can't determine exactly what the corresponding chord symbol would be. You can try to predict it, and the musical context of the piece helps tremendously with that, but there are many ways to harmonize a melody (or write a melody for a given harmony).
Is a melody sufficient to prescribe a chord symbol?
Two Notes is Not Enough*
when only F and Eb notes are present, is it safe to write F7 on top of the bar?
Nope. Although F7 may be a common option, there are a lot of chords that could have an F and Eb played over them. As a creative exercise, lets try to imagine those two notes on top of all 12 bass notes:
- C - With C as the bass, we have the minor 3rd and perfect 4th, so Cm11 and related chords come to mind.
- Db - Now Eb and F are our major 2nd and major 3rd, so Dbmaj9, Db9, Dbadd2, and any other valid configurations.
- D - Eb is our minor 2nd which in common popular music scenarios appears with dominant chords, and F is the minor 3rd, so let's call these the flat 9th and sharp ninth and make some D altered sounds (D7b9#9, others).
- Eb - Any Eb chord that has the 9th or 2nd.
- E - This one's tough. Exercise for the reader!
- F - Any F seventh chord will work, either dominant or minor.
- Gb - Eb is the major 6th, F is the major 7th, so Gb major- or lydian-type chords work.
- G - Minor 6th, minor 7th, so aeolian chords fit.
- Ab - P5 and M6, so Ab6 is the easiest one to call out.
- A - d5 and m6, so A altered sounds like A7b5b13.
- Bb - P4, P5 means any suspended sound like Bbsus and its extensions, or minor 11th chords.
- B - M3, A4 suggests lydian or B7b5.
*We only used 2 notes here, but a creative reharmonizer could do this with a melody of pretty much any number of notes.
The Above List was a Tiny Subset of the Possibilities
Keep in mind here that I only listed one option for each bass note, and this is assuming that the melody has to be part of the chord, which is absolutely not the case in real life. Did I mention this assumes both notes are within the same chord? That's a big assumption. And this is just in a context of mostly popular music usage, so there are practically infinitely many ways that the Eb and F could be harmonized.
What are some practical takeaways for more causal-setting music notation?
Since that Wasn't Righttm, here's what Chord Symbols Actually Mean
Chord symbols come from the harmony of a piece/song. For popular music, that harmony usually has an instrument playing a chord, or a bunch of notes that make one harmonic sound together - think guitar strumming, piano playing, or synthesizers of any sort. The chord symbol comes from whatever that instrument or group of instruments is playing, and they get written down to inform a musician of what chords to play to accompany the song's melody.
The melody is written down as what a musician should play or sing to carry the main theme of the piece. This could be a different musician than the one who might be reading the chord symbols! The songwriter or composer is the one who wrote that melody. As mentioned earlier, there's a lot of unique melodies to go with a given harmony and vice versa. Some writers write the melody first and some write the harmony first, either is possible.
Sheet Music and Chord Symbols are Related, but Designed for Separate People
Chord symbols represent chord changes/progressions for instrumentalists playing a supporting harmonic role in the song, like a rhythm guitarist, a keyboard player, a pianist, or even a bassist. They only tell you what chord to play, and not what exact notes or rhythms to use.
Melodies are usually for a solo or lead instrumentalist, like a singer, trumpet, violin, lead guitarist, etc. Typically melodies are written down more precisely, but there's still some room for improvisation or differences in interpretation.
When you have forms of music notation designed for both roles to read in a jam-type setting (meaning the notation is just reminders or guides for players), you get lead sheets (chord symbols written over just a melody), or even just lyrics written down with chord changes above the words. It's a good thing these have differing levels of complexity, since trying to match a chord symbol to every note of a melody would be pointlessly confusing and trying to spell out every single note of a chordal accompaniment is almost always needlessly complicated!
Chord symbols are separate from melodies, so don't worry if they don't exactly match all the time. The point is to make things simple while still communicating the essence of the song clearly.