Music

On linux sounds can be created from the console. This can be done using a multi-purpose library front-ended by SoX. The part of SoX which plays sound (it can also record sound) is called 'play'.

Here is the console command to play a synthesised `A minor seventh' chord with a pipe-organ sound:

play -n -c1 synth sin %-12 sin %-9 sin %-5 sin %-2 fade h 0.1 1 0.1

Piano

Another approach is to use a library called Tone.js. This is installed on the sever. i.e It can be installed locally using
npm install tone
Then copied to the server. After that it is just loaded into the web page in the usual way using a script element.
The system needs to be turned on before it works:
After that you can just press a button to get some sound:
The code has documentation here: Tone.js