Methylates 3-aminomethylindole (AMI) and N-methyl-3-aminomethylindole (MAMI), two substrates involved in gramine biosynthesis, a toxic indole alkaloid. Can use S-adenosyl-L-methionine (AdoMet) as a methyl donor. Unable to mediate caffeic acid O-methylation. 3-(aminomethyl)indole + 2 S-adenosyl-L-methionine = gramine + 2 H(+) + 2 S-adenosyl-L-homocysteine Repressed by sodium carbonate, sodium bicarbonate and K-phosphate. Optimum pH is 9. Alkaloid biosynthesis. More present in the fifth leaf than in the second leaf (at protein level). Induced by jasmonic acid (PubMed:9524816). Triggered by high temperatures; 35 degrees Celsius day/30 degrees Celsius night (at protein level) (PubMed:16664431). Present and expressed only in cultivars containing gramine (e.g. cv. 5172-28:4, cv. 5172-39:9, cv. 5175-50:20, cv. Hordeum vulgare ssp. spontaneum accession 5, cv. Golf, cv. Lina, cv. Barke, cv. Sultan5, cv. Igri, cv. Salome and cv. Osiris) but not detected in cv. CI 16145, cv. CI 11506, cv. Mona, cv. Morex and cv. Maythorpe. Belongs to the class I-like SAM-binding methyltransferase superfamily. Cation-independent O-methyltransferase family.