well, you have to calculate the frequencies and make a parallel:
-for picbasic: 0=silence; 1=78.74hz; 2=2*78.74; 3=3*.. and so on...
-for the piano there is no such as linearity and you must know the correspondence between keys and freqs (from some tables or a piano-player);