Q. Is one permitted to whistle a tune on Shabbos?
A. Remah (Shulchan Aruch O.H. 338: 1) ruled that one may call others attention by whistling on Shabbos. Mishna Berura (ibid 3) quotes Magen Avrohom that even if one whistles a proper tune, it is permitted, as it is similar to any other singing by mouth, which is permissible on Shabbos.
However, there are dissenting opinions. Birkei Yosef (Shiyurei Berocho, 338) quotes Rabbeinu Pinchas Anav that whistling a tune on Shabbos is forbidden. Nevertheless, the Chido himself on Machazik Brocho (ibid.) writes that based on the above ruling of the Remah, it has become habitual in the lands of Germany and Poland to whistle tunes on Shabbos, even when they resemble actual musical instruments.
Nonetheless, using a whistle or any other instrument is prohibited.
Horav Shlomo Miller’s Shlit’a opinion is similar
Rabbi A. Bartfeld as advised by Horav Shlomo Miller and Horav Aharon Miller Shlit’a