Modular functions and special cycles