You need aural training to be able to play *intervals* you hear or hum. You won't be able to pick absolute notes unless your parents gave you aural training when you were very young. There are apps (GNU solfege is supposed to do it but I've never gotten it to grade my singing interval accuracy) for this or you can just sit in front of a piano and do it the old fashion way.
For improvising you need to understand theory. Piston's book is very good but I haven't found a place to pirate it (I got mine in a used book store in the mountains of Virginia.)
Of course you also need to know your instrument (whether it's singing or piano or guitar) and you'll need to be able to read sheet music. It doesn't take too much practice to get to the point where you're comfortable enough but it does take some.