Tone.js inconsistency of Gain attached to synth

I am new to Tone.js and have a problem with the Gain object. I have a volume slider set up in html as follows: