Written here are some melodies in various times and keys for you to harmonize with primary triads. In the beginning, it is a good idea to write down the notes contained in the primary triads of the key of the melody you are working on. In time, you will know them from memory and this will become unnecessary. Once you have harmonized each melody, play both the melody and harmony on the keyboard or guitar and experiment with different inversions of the chords. Always use inversions which are close together on the instrument, as this will produce the smoothest sound. If you do this often enough, in time you will be able to improvise accompaniments to melodies the first time you hear them. Most of the great composers were brilliant at this.