We generalize the recent work of Viazovska by constructing infinite families of Schwartz functions, suitable for Cohn-Elkies style linear programming bounds, using quasimodular and modular forms. In particular for dimensions d ≡ 0 (mod 8) we give the constructions that lead to the best sphere packing upper bounds via modular forms. In dimension 8 and 24 these exactly match the functions constructed by Viazovska and Cohn, Kumar, Miller, Radchenko, and Viazovska which resolved the sphere packing problem in those dimensions.