As a more detailed explanation of why learnSong uses different numbers from getForm, it's because learnSong uses the index of a particular song you want the player to learn (Energy Form, Bind, Li*, etc.), while getForm returns the (completely unrelated) index of the form that the player is currently in (which is limited to just forms, not "forms and any other songs you happen to have"). You can find the numbers for both forms and songs in entityinclude.lua in the game's data files, although actually finding any particular number in that file takes a bit of searching.
Incidentally, learnSong(0) will teach the player the "heal" song, which has a broken animation and heals the player for about a tenth of a circle of health (I believe it is one hitpoint).
[EDIT] Here's the note sequence for it:

- Edwards
* Although you can trivially teach the player Li's song, actually adding him to a mod is a bit more complex, and I haven't bothered to figure out how to do so.