Kitzur Likutei Moharan I, 27:5
And through the rectification of the covenant one merits the voice, so that the voice of his song is purified. And Jacob, who guarded his covenant, as it is written: "the first of my strength," merited the voice, as it is written: "The voice is the voice of Jacob." And then, through hearing the voice of his song and his melody alone, God, blessed be He, sees who is oppressing us and which idolater of the seventy tongues is oppressing us, and saves us from the trouble. Therefore, when there is, God forbid, some decree and trouble for Israel from some idolater, then it is good to sing the melody of that idolater who is oppressing them, God forbid. And this is "when He heard their song (rinatam)," that is, their song and melody, as mentioned above. For through song and melody for the sake of Heaven one can arouse His mercies, blessed be He, so that He will look upon our troubles that we have from that nation and save us from them.
View original Hebrew
וְעַל יְדֵי תִּקּוּן הַבְּרִית זוֹכֶה לַקּוֹל שֶׁיִּזְדַּכֵּךְ קוֹל רִנָּתוֹ. וְיַעֲקב שֶׁשָּׁמַר בְּרִיתוֹ כְּמוֹ שֶׁכָּתוּב "רֵאשִׁית אוֹנִי" זָכָה לַקּוֹל כְּמוֹ שֶׁכָּתוּב "הַקּל קוֹל יַעֲקב" . וַאֲזַי עַל יְדֵי שְׁמִיעַת קוֹל רִנָּתוֹ וְנִגּוּנוֹ לְבַד הַשֵּׁם יִתְבָּרַךְ רוֹאֶה מִי שֶׁמֵּצֵר לָנוּ וְאֵיזֶה עַכּוּ"ם מֵהַשִּׁבְעִים לָשׁוֹן מֵצֵר לָנוּ וּמוֹשִׁיעַ מֵהַצָּרָה. עַל כֵּן כְּשֶׁיֵּשׁ חַס וְשָׁלוֹם אֵיזֶה גְּזֵרָה וְצָרָה לְיִשְׂרָאֵל מֵאֵיזֶה עַכּוּ"ם אָז טוֹב לְנַגֵּן הַנִּגּוּן שֶׁל אוֹתוֹ הָעַכּוּ"ם שֶׁמֵּצֵר לָהֶם חַס וְשָׁלוֹם וְזֶהוּ "בְּשָׁמְעוֹ אֶת רִנָּתָם" הַיְנוּ רִנָּה וְנִגּוּן שֶׁלָּהֶם כַּנַּ"ל. כִּי עַל יְדֵי רִנָּה וְנִגּוּן לְשֵׁם שָׁמַיִם יְכוֹלִין לְעוֹרֵר רַחֲמָיו יִתְבָּרַךְ שֶׁיִּרְאֶה בְּצָרוֹתֵינוּ שֶׁיֵּשׁ לָנוּ מֵאוֹתָהּ הָאֻמָּה וְיוֹשִׁיעֵנוּ מֵהֶםRead this passage within Part I · Torah 27, in its full context