I understand fully how to harmonise a melody and could do so if I wished. However, I would like to quickly put together a CD of accompaniments of a large number of songs to use in a community singing group. What I want to do is to input the melody of a chosen song in whatever key I think will be appropriate for the group and indicate the chords I would like to be played above certain notes; the software would then play back the melody with the chords. Is there software that would do this without my having to pay a fortune? The easiest thing would probably be to have a digital keyboard which records whatever I put into it but I only have a rather ancient one which can't convert to a media file. Any ideas would be greatly appreciated.
Band in a Box. http://www.pgmusic.com/
But what do you mean, your keyboard won't "convert to a media file"? You can't put a microphone in front of it, or connect a cable from Line Out, or even the headphone output, to an external recorder?
I fully agree that Band-in-a-box should do what you need, except for the "having to pay a fortune" requirement. The most basic version of it costs $129, and you should do some research whether this basic version actually supports all the features you need. My guitar teacher recently suggested iReal Pro (irealpro.com) for me to use, which does something similar for a fraction of the price - Android/iPhone version costs $13 and the Mac version costs $20. You can input the chords there and the bass/drums arrangement will be auto-generated (there are several styles you can choose from). You have to check with them whether they cover all your requirements, but from what you describe you don't seem to need the advanced features of Band-in-a-box (they can generate melody for a harmony and vice-versa, create a solo, etc. - lots of features that you may not really need, but you will have to pay for anyway).
The software I develop, JJazzLab, can do most of what you want for free, and the framework is open-sourced.
It's the same idea than Band-In-A-Box, you type-in chords and it generates an accompaniment.